<?php
//require("../twitter/gettweets.php");
$getNewTweet= file_get_contents("../twitter/retrieveTweets.php");
 mysql_connect ("localhost","root", "root") or die ('Error'.mysql_error());
 mysql_select_db ("streamtube");
 if(isset($_GET["user"])) {
 	$result = mysql_query("SELECT * FROM tweets WHERE username = '".$_GET["user"]."' and `deleted` = '0'");
 	//$result = mysql_query("SELECT * FROM tweets");
    $table = array();
    while ($row = mysql_fetch_array($result)) {
    	$table[] = $row;
    }
    //var_dump($table);
    $jsonTable = json_encode($table);
    echo $jsonTable;
 	
 }
   
       
      
 mysql_close();

//getTweets();
?>